<template>
  <div>
    <el-button class="demo-button" :type="type">
      <slot />
    </el-button>
  </div>
</template>

<script>
import { Button } from 'element-ui'
import axios from 'axios'

export default {
  name: 'demo-button',
  components: { ElButton: Button },
  props: {
    type: {
      type: String,
      default: 'primary',
    },
  },
  created() {
    axios
      .get('https://apiblog.jspang.com/default/getGirl')
      .then(({ data: { imgUrl } }) => {
        console.log(imgUrl)
      })
  },
}
</script>
